import React from "react";
import { Router, Route, IndexRoute, hashHistory, Redirect } from 'react-router'
import {isLogin} from "@utils/common";
import * as base from '@pages/base'
import * as sys from '@pages/sys'
import * as echarts from '@pages/eCharts'
import ArticleManage from '@pages/article'

export default () => (
    <Router history={hashHistory}>
        <Route path='/' component={base.app} onEnter={isLogin}>
            <IndexRoute component={base.welcome}/>
            <Route path="sys/menuManage" component={sys.MenuManage}/>
            <Route path="/article" component={ArticleManage}/>
            <Route path="/graph" component={echarts.graph}/>
        </Route>
        <Route path='/login' component={base.login}/>
        <Route path='*' component={base.notFound}/>
    </Router>
)
